import Vue from 'vue'
import Router from 'vue-router'
import routes from './routers.js'

Vue.use(Router)

const router = new Router({
  /* mode: 'history',
  scrollBehavior: function (to, from, savedPosition) {
    return savedPosition || {x: 0, y: 0}
  }, */
  linkActiveClass: 'list-active',
  routes,
  scrollBehavior (to, from, savedPosition) {
    if (savedPosition) {
      return savedPosition
    } else {
      return { x: 0, y: 0 }
    }
  }
})

export default router
